let instance = axios.create({
    headers: {
      Authorization:localStorage.getItem('token') || ''
    }
  })
instance.interceptors.request.use(
  config => {
      console.log(123)
      const token =localStorage.getItem('token') || ''
      if (token ) { // 判断是否存在token，如果存在的话，则每个http header都加上token
          config.headers.Authorization = token  //请求头加上token
      }
      return config
    },
    err => {
      return Promise.reject(err)
    })